package br.com.robot.util;

import java.util.ArrayList;
import java.util.List;

import br.com.model.SeedsToNavigate;
import br.com.model.dao.DAOFactory;
import br.com.robot.RobotList;

public class RobotsUtils 
{
	/**
	 * @param robotId id do robo que esta registrado em {@link RobotList}
	 * @return
	 */
	public synchronized static List<String> buscaSeeds( int robotId )
	{
		String sql = String.format( "select s from SeedsToNavigate s where s.robo = '%s'", robotId );

		List<SeedsToNavigate> busca = DAOFactory.infDao( ).busca( sql , SeedsToNavigate.class );
		
		List<String> lst = new ArrayList<String>( );
		
		for( SeedsToNavigate item : busca )
		{
			lst.add( item.getUrl( ) );
		}
		
		return lst;
	}
}